import java.util.*;

public class MiningNobel {
	
        public static int fourSum(double[] a)
        {	
			System.out.println("FourSumSlow is running!");
                int N = a.length;
                int cnt = 0;
                for(int  i= 0; i < N; i++)
                        for(int j = 0; j < N; j++)
                                for(int k = 0; k < N; k++)
                                        for(int l = 0; l < N; l++)
                                                if(a[i] + a[j] + a[k] + a[l] == 0)
                                                        cnt++;
                return cnt;
        }

	public static int fourSumFast(double[] a)
		{
			Arrays.sort(a);
			int N = a.length;
			int cnt = 0;
			for (int i = 0; i < N ; i++)
				for (int j = 0; j < N; j++) 
					for (int k = 0; k < N; k++) 
						if(Arrays.binarySearch(a, -a[i]-a[j]-a[k]) > -1)
							cnt++;
			return cnt;
        }
		

	public static void main(String[] args)
	{
		ArrayList<String> al = new ArrayList<String>();
		
		while(StdIn.hasNextLine() && !StdIn.isEmpty())
		{
			al.add(StdIn.readLine());
		}
		
		double[] a = new double[al.size()];
		
		for(int i = 0; i < a.length; i++)
		{
			StringTokenizer stk = new StringTokenizer(al.get(i), ",");
			stk.nextToken();
			a[i] = Double.parseDouble(stk.nextToken());
		}
		
		Stopwatch sw = new Stopwatch();
		System.out.println(fourSumFast(a));
		System.out.println(sw.elapsedTime());
	}
}
